﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 多态练习吃饭
{
    class Food
    {
        public virtual void ByEat()
        {
            Console.WriteLine("食物被吃");
        }
    }

    class Meat :Food
    {
        public override void ByEat()
        {
            // base.ByEat();
            Console.WriteLine("肉好吃");
        }
    }

    class Noodle : Food
    {
        public override void ByEat()
        {
            Console.WriteLine("面条被吃，还可以");
        }
    }

    class Rice : Food
    {
        //public override void ByEat()
        //{
        //    Console.WriteLine("米饭被吃，不好吃");
        //}
    }
}
